package com.example.study1206.service;

import com.example.study1206.Utils.RedisUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component("Redis")
public class RedisServiceImp implements MultipleService {
    @Autowired
    RedisUtil redisUtil;

    @Override
    public String getByKey(String key) {
        return redisUtil.get(key);
    }

    @Override
    public String set(String key, String value) {
        return redisUtil.set(key, value);
    }

    @Override
    public Boolean isExist(String key) {
        return redisUtil.exists(key);
    }

    @Override
    public Long delete(String key) {
        return redisUtil.del(key);
    }

    @Override
    public String getAll() {
        return redisUtil.getAll().toString();
    }
}
